package com.itlong.cloud.project.operate;


import com.itlong.cloud.POJO.DTO.operate.InterfaceDTO;
import com.itlong.cloud.POJO.PO.InterfacePO;
import com.itlong.cloud.POJO.VO.operate.InterfaceVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 *运营-接口类型接口暴露接口
 */
@FeignClient(name = "project-service")
@Repository
public interface IOperateInterfaceServiceClient {
    /**
     * <desc>
     *      :添加接口
     * <desc>
     * @param interfacePO
     * @return: java.lang.Integer
     * @date: 2021-08-16 13:55
     **/
    @RequestMapping(path = "/saveInterface",method = RequestMethod.POST)
    Integer saveInterface(@RequestBody InterfacePO interfacePO) throws Exception;

    /**
     * <desc>
     *      :修改接口
     * <desc>
     * @param interfacePO
     * @return: java.lang.Integer
     * @date: 2021-08-16 13:55
     **/
    @RequestMapping(path = "/updateInterface",method = RequestMethod.POST)
    Integer updateInterface(@RequestBody InterfacePO interfacePO) throws Exception;

    /**
     * <desc>
     *      :删除接口
     * <desc>
     * @param interfaceId 接口id
     * @param updateUserId 用户id
     * @return: java.lang.Integer
     * @date: 2021-08-16 13:56
     **/
    @RequestMapping(path = "/deleteInterface",method = RequestMethod.POST)
    Integer deleteInterface(@RequestParam("interfaceId") String interfaceId,@RequestParam("updateUserId")String updateUserId) throws Exception;

    /**
     * <desc>
     *      :条件查询接口
     * <desc>
     * @param interfaceName
     * @param status
     * @param startTime
     * @param endTime
     * @return: java.util.List<com.itlong.cloud.POJO.PO.InterfacePO>
     * @date: 2021-08-16 13:57
     **/
    @RequestMapping(path = "/getInterfaceList",method = RequestMethod.POST)
    List<InterfacePO> getInterfaceList(@RequestParam("interfaceName")String interfaceName,
                              @RequestParam("status")int status,
                              @RequestParam("startTime")String startTime,
                              @RequestParam("endTime")String endTime)throws Exception;


    /**
     * <desc>
     *      :分页查询
     * <desc>
     * @param interfaceDTO
     * @return: com.itlong.cloud.utils.page.Page<com.itlong.cloud.POJO.VO.operate.InterfaceVO>
     * @date: 2021-08-16 13:57
     **/
    @RequestMapping(path = "/getInterfacePageList",method = RequestMethod.POST)
    Page<InterfaceVO> getInterfacePageList(InterfaceDTO interfaceDTO)throws Exception;

    /**
     * <desc>
     *      :更新接口启用、禁用状态
     * <desc>
     * @param interfaceId
     * @param status
     * @param updateUserId
     * @return: java.lang.Integer
     * @date: 2021-08-16 13:59
     **/
    @RequestMapping(path = "/updateStatus",method = RequestMethod.POST)
    Integer updateStatus(@RequestParam("interfaceId")String interfaceId,
                         @RequestParam("status")int status,
                         @RequestParam("updateUserId")String updateUserId)throws Exception;


    /**
     * 修改及接口文档
     * @param interfaceId 接口id
     * @param interfaceDocx 接口文档
     * @param updateUserId 用户id
     * @return
     * @throws Exception
     */
    @RequestMapping(path = "/updateDocx",method = RequestMethod.POST)
    Integer updateDocx(@RequestParam("interfaceId")String interfaceId,
                       @RequestParam("interfaceDocx")String interfaceDocx,
                       @RequestParam("updateUserId")String updateUserId)throws Exception;
}
